package com.youth.koodoReaderManager.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@TableName("koodo_book_info") // 指定MyBatis Plus映射的数据库表名
public class Book {
    @TableId(value = "key", type = IdType.INPUT) // 指定MyBatis Plus的主键字段
    @ApiModelProperty(value = "数据库的唯一键", required = true)
    private Integer key;

    @ApiModelProperty(value = "书籍名称", required = true)
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "书籍作者")
    @TableField("author")
    private String author;

    @ApiModelProperty(value = "书籍描述")
    @TableField("author")
    private String description;

    @ApiModelProperty(value = "epub文件的md5值，用于防止重复导入", required = true)
    @TableField("md5")
    private String md5;

    @ApiModelProperty(value = "封面图片路径")
    @TableField("cover")
    private String cover;

    @ApiModelProperty(value = "书籍格式，如epub, pdf等")
    @TableField("format")
    private String format;

    @ApiModelProperty(value = "出版社名称")
    @TableField("publisher")
    private String publisher;

    @ApiModelProperty(value = "文件大小，单位为字节", required = true)
    @TableField("size")
    private long size;

    @ApiModelProperty(value = "书籍总页数")
    @TableField("page")
    private int page;

    @ApiModelProperty(value = "文件存储路径")
    @TableField("path")
    private String path;

    @ApiModelProperty(value = "字符编码格式")
    @TableField("charset")
    private String charset;

    // 构造函数、getter和setter方法 (由Lombok的@Data注解自动生成)
}